home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 626-637 / disk_635 / ldp / source / video.h < prev   
C/C++ Source or Header  |  1992-05-06  |  7KB  |  133 lines

  1. /*                       **Protocols**                                   *\
  2. **                                                                       **
  3. ** sony: Computer activates DTR (pin 20) on rs-232 port,                 **
  4. ** (amiga 7-line handshake)                                              **
  5. ** then sends a command and expects ACK back. ASCII digits used for      **
  6. ** addresses,etc. Expect ACK back after EACH digit sent. Returns frame#  **
  7. ** as ASCII digits. Player is single character oriented.                 **
  8. **                                                                       **
  9. ** hitachi: Computer activates CTS (pin5) on rs-232 port and             **
  10. ** sends a command and expects JOB END back (command + 80H) usually.     **
  11. ** Commands used with enter will echo back enter and then return         **
  12. ** JOB END. ASCII digits used for addresses,etc. Returns frame# as       **
  13. ** two bytes (hi-lo). Player is string oriented.                         **
  14. **                                                                       **
  15. ** pioneer: Computer activates CTS (pin5) of rs-232 port,                **
  16. ** (amiga 7-line handshake)                                              **
  17. ** then sends a command sequence and expects 'R' and carriage return(CR) **
  18. ** back. ASCII digits used for addresses,etc. Returns frame# as ASCII    **
  19. ** digits. Player is string oriented and reverse-polish (arg then verb). **
  20. **                                                                       **
  21. ** SURPRISE! I don't usually check to see what player returns!           **
  22. ** If you want it, ADD it! This is only an example!                      **
  23. \*                                                                       */
  24.  
  25.  
  26. /* sony stuff */
  27. #define ACK         '\xA'     /* acknowledge               */
  28. #define NAK         '\xB'    /* command not accepted      */
  29. #define COMPLETION  '\x1'   /* successful search,repeat  */
  30. #define ERROR       '\x2'  /* error condition           */
  31.  
  32. /* hitachi stuff */
  33. #define GS  '\x1D'   /* format error               */
  34. #define RS  '\x1E'  /* incorrect operation error  */
  35.  
  36. /* pioneer stuff */
  37. #define E00    "E00"      /* communication error   */
  38. #define E04    "E04"     /* feature not available */
  39. #define SLOW   12       /* slow speed            */
  40. #define NORMAL 60      /* normal speed          */
  41. #define FAST   180    /* fast speed            */
  42. #define SCAN   255   /* Pioneer scan MUTANT!  */
  43.  
  44. #define NUMCMDS 18     /*   the number of video commands      */
  45. char *VideoCmd[] = {"address","baud","clear","eject","enter","forward",
  46.                     "frame","index","init","play","quit","ready","repeat","reverse",
  47.                     "search","still","vplayer", "illegal" } ;
  48. enum vidcmd        { address, baud, clear, eject, enter, forward,
  49.                      frame, index, init, play, quit, ready, repeat, reverse,
  50.                      search, still, vplayer, illegal } ;
  51.  
  52. #define NUMSPEEDS 5
  53. char *speedstr[] = {"step","slow","fast","scan","normal"} ;
  54. enum speedcmd {step,slow,fast,scan,normal} ;
  55. #define NUMINDEXS 2
  56. char *indexstr[] = {"off","on"} ;
  57. enum indexcmd {off,on} ;
  58.  
  59. char *PlayerStr[] = {"sony","hitachi","pioneer","none"} ;
  60. enum vplayers       { sony,  hitachi,  pioneer,  none } ; /* player types */
  61.  
  62. struct vnodes {
  63.   char  *generic[NUMCMDS]    ;            /* generic commands              */
  64.   char  *forward[NUMSPEEDS]  ;           /* forward commands              */
  65.   char  *reverse[NUMSPEEDS]  ;          /* reverse commands              */
  66.   char  *index[NUMINDEXS]    ;         /* index commands                */
  67.   BOOL  pready               ;        /* player ready? (not used)      */
  68.   BOOL  rp                   ;       /*  reverse polish?              */
  69.   char  *special1            ;      /* player specific special cmd 1 */
  70.   char  *special2            ;     /*   "       "        "      " 2 */
  71.   char  *term                ;    /* string terminator character   */
  72.   int   returnbytes          ;   /* # bytes returned from player  */
  73.   int   statbytes            ;  /* number of status bytes        */
  74.   int   addrbytes            ; /* number of address bytes       */
  75. }  ;
  76.  
  77. struct vnodes Player[3] = {
  78.  
  79. /* **SONY** */
  80.  
  81. /* address   baud    clear     eject      enter   forward   */
  82. {   "`",     "\0",    "V",      "*",      "@",     ":",
  83. /*  frame  index      init       play  quit   ready    repeat  reverse  */
  84.      "U",   "P",      "V'",      ":",  "\0",   "g",     "D",     "J",
  85. /*  search    still   vplayer  illegal       */
  86.      "C",      "O",     "\0",    "\0",
  87. /*   FStep     FSlow     FFast     FScan  FNormal   */
  88.      "+",       "<",      ";",      ">",   ":",
  89. /*   RStep     RSlow     RFast     RScan  RNormal   */
  90.       ",",      "L",      "K",      "N",   "J",
  91. /*  IndexOff   IndexOn   */
  92.      "Q",        "P",
  93. /* pr    rp     s1     s2    term   rb  sb   ab   */
  94.    TRUE,FALSE, "\0",  "\0",  "\0",  1,  5,   5 },       /* END of sony         */
  95.  
  96.  /* **HITACHI**      clear=mode1 eject=reject init=remote ready=status2  */
  97. /* repeat=memory2 still=pause FScan= "                                  */
  98.  
  99. /* address   baud    clear     eject      enter   forward   */
  100. {   "k",     "\0",   "n",       "/",      "A",     "%",
  101. /*  frame  index      init       play  quit   ready    repeat  reverse  */
  102.     ":",   "L",       "h",       "%",  "\0",  "j",     ")",    "B",
  103. /*  search    still   vplayer  illegal       */
  104.     "+",      "*",     "\0",    "\0",
  105. /*   FStep     FSlow     FFast     FScan     FNormal   */
  106.      "$",      "#",      "!",      "\x22", "%",
  107. /*   RStep     RSlow     RFast     RScan  RNormal   */
  108.      ")",      "(",      "&",      "'",   "B",
  109. /*  IndexOff   IndexOn   */
  110.      "M",       "L",
  111. /* pr    rp     s1     s2    term   rb  sb   ab    */
  112.    TRUE,FALSE,  "$",   ")",  "\0",  1,  2,   3 },      /* END of hitachi */
  113.  
  114. /* **PIONEER** */
  115. /* Forward scan and Reverse scan are MUTANT so used multi-speed fwd/rev */
  116. /* address   baud    clear     eject      enter   forward   */
  117. {   "?F",    "\0",   "CL",     "OP",      "\0",    "PL",
  118. /*  frame  index      init       play  quit   ready    repeat  reverse    */
  119.     "FR",  "1DS",  "3AD1VDFR",   "PL", "\0",  "?P",    "\0",   "60SPMR",
  120.  
  121. /*  search    still   vplayer  illegal       */
  122.     "SE",     "ST",    "\0",    "\0",
  123. /*   FStep     FSlow       FFast       FScan    FNormal      */
  124.      "SF",    "12SPMF",   "180SPMF", "255SPMF",  "PL",
  125. /*   RStep     RSlow       RFast       RScan    RNormal     */
  126.      "SR",    "12SPMR",   "180SPMR", "255SPMR", "60SPMR",
  127. /*  IndexOff   IndexOn   */
  128.     "0DS",      "1DS",
  129. /* pr    rp     s1     s2    term   rb  sb   ab */
  130.    TRUE,TRUE,  "\0",  "\0",  "\r",  2,  4,   6  } } ; /* end of pioneer */
  131.  
  132. /*  END   */
  133.